<div class="main-content">
	<!-- #section:basics/content.breadcrumbs -->
	<div class="breadcrumbs" id="breadcrumbs">
		<script type="text/javascript">
			try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
		</script>

		<ul class="breadcrumb"><li>
			<i class="ace-icon fa fa-th-large th-large-icon"></i> 系统管理 <i class="ace-icon fa fa-angle-double-right"></i> 更新设施设备 
		</li></ul><!-- /.breadcrumb -->
	</div>

	<!-- /section:basics/content.breadcrumbs -->
	<div class="page-content">
		<!-- #section:settings.box -->
		<div class="ace-settings-container" id="ace-settings-container" style="margin-top:-48px;">
			<div class="btn btn-app btn-xs btn-warning ace-settings-btn" id="ace-settings-btn">
				<i class="ace-icon fa fa-cog bigger-150"></i>
			</div>
			<div class="ace-settings-box clearfix" id="ace-settings-box">
				<div class="pull-left width-50">
					<!-- #section:settings.skins -->
					<div class="ace-settings-item">
						<div class="pull-left">
							<select id="skin-colorpicker" class="hide">
								<option data-skin="no-skin" value="#438EB9" <?=!isset($_COOKIE['ace_skin'])||$_COOKIE['ace_skin']!='no-skin'?'selected':''?> >#438EB9</option>
								<option data-skin="skin-1" value="#222A2D" <?=isset($_COOKIE['ace_skin'])&&$_COOKIE['ace_skin']=='skin-1'?'selected':''?> >#222A2D</option>
								<option data-skin="skin-2" value="#C6487E" <?=isset($_COOKIE['ace_skin'])&&$_COOKIE['ace_skin']=='skin-2'?'selected':''?> >#C6487E</option>
								<option data-skin="skin-3" value="#D0D0D0" <?=isset($_COOKIE['ace_skin'])&&$_COOKIE['ace_skin']=='skin-3'?'selected':''?> >#D0D0D0</option>
							</select>
						</div>
						<span>&nbsp;肤色切换</span>
					</div>

					<!-- /section:settings.skins -->

					<!-- #section:settings.navbar -->
					<div class="ace-settings-item">
						<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-navbar" />
						<label class="lbl" for="ace-settings-navbar">&nbsp; 固定导航</label>
					</div>

					<!-- /section:settings.navbar -->

					<!-- #section:settings.sidebar -->
					<div class="ace-settings-item">
						<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-sidebar" />
						<label class="lbl" for="ace-settings-sidebar">&nbsp; 固定菜单栏</label>
					</div>
					<!-- /section:settings.sidebar -->
					
					<!-- #section:settings.container -->
					<div class="ace-settings-item">
						<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-add-container" />
						<label class="lbl" for="ace-settings-add-container">&nbsp; 宽窄屏切换</label>
					</div>
					<!-- /section:settings.container -->
				</div><!-- /.pull-left -->

				<div class="pull-left width-50">
					<!-- #section:basics/sidebar.options -->
					<div class="ace-settings-item">
						<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-hover" />
						<label class="lbl" for="ace-settings-hover">&nbsp; 内级栏目切换</label>
					</div>

					<div class="ace-settings-item">
						<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-compact" />
						<label class="lbl" for="ace-settings-compact">&nbsp; 菜单栏切换</label>
					</div>

					<div class="ace-settings-item">
						<input type="checkbox" class="ace ace-checkbox-2" id="ace-settings-highlight" />
						<label class="lbl" for="ace-settings-highlight">&nbsp; 当前菜单凸显</label>
					</div>
					<!-- /section:basics/sidebar.options -->
				</div><!-- /.pull-left -->
			</div><!-- /.ace-settings-box -->
		</div><!-- /.ace-settings-container -->

		<!-- /section:settings.box -->
		<div class="page-content-area">
			<div class="row">
				<form>
					<div class="col-xs-12 col-sm-4 col-lg-3" style="margin-top:10px;">
						<input type="text" name="keyword" placeholder="关键字搜索酒店" data-rel="tooltip" title="关键字搜索酒店">
						<button type="button" class="btn btn-sm pull-left btn-default" onclick="search()">搜索</button>
					</div>
					<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2 searchCity" style="margin-top:10px;">
						<style>
						#cityItem{
							position: absolute;width: 348px;min-height: 100px;border: 1px solid #b9b9b9;background-color: #fff;display: none;
							margin-top:0;*+margin-top: -1px;margin-top: 0\0;line-height: normal;z-index: 15;
						}
						#cityItem label{color: #b9b9b9;position: absolute;top: 1px; left: 5px;display: inline-block;}
						#cityItem img{position: absolute;top: 1px; right: 1px;cursor: pointer;}
						#cityItem div.prefix{
							margin-top: 25px;font-size: 12px;color: #555555;border-bottom: 2px solid #b9b9b9;padding-bottom: 5px;
						}
						#cityItem div.prefix span{display: inner-block;padding: 5px;cursor: pointer;}
						#cityItem div.prefix span:hover,#cityItem div.prefix span.active{
							color: #3d9adb;border-bottom: 2px solid #3d9adb;
						}
						#cityItem div.city_text{display: none;}
						#cityItem div.city_active{display: block;}
						#cityItem div.city_text div.city_text_TT{float: left;width: 25px;text-align: center;color: #f38335;padding: 12px 0;}
						#cityItem div.city_text div.city_text_BB{float: left;width: 301px;padding-top: 10px;}
						#cityItem div.city_text div.city_text_BB span{
							display: block;margin-bottom: 10px;float: left;padding: 2px 8px;cursor: pointer;color: #555555;min-width: 30px;
						}
						#cityItem div.city_text div.city_text_BB span:hover{background-color: #3d9adb;color: #fff;}
						#cityItem div.city_text div.city_text_BB span.cityActive{background-color: #888888;color: #fff;}
						</style>
						<input class="form-control" name="CityName" placeholder="城市选择" data-rel="tooltip" title="城市选择" style="max-width:210px;cursor:default;background:#fff!important;" readonly />
						<input type="hidden" name="city" />
						<div id="cityItem">
							<label>请选择城市</label>
							<img src="/public/home/img/close.png" title="关闭" alt="关闭" onclick="closeImg()" />
							<div class="prefix">
								<span class="active" lang="0">ABCD</span>
								<span lang="1">EFGH</span>
								<span lang="2">IJKL</span>
								<span lang="3">MNOP</span>
								<span lang="4">QRST</span>
								<span lang="5">UVWX</span>
								<span lang="6">YZ</span>
							</div>
							<?
							if($this->cityItem){
							foreach($this->cityItem as $k=>$v){?>
							<div class="city_text <?= $k == 'ABCD' ? 'city_active' : '' ?> city_text_<?if($k=='ABCD'){echo 0;}elseif($k=='EFGH'){echo 1;}elseif($k=='IJKL'){echo 2;}elseif($k=='MNOP'){echo 3;}elseif($k=='QRST'){echo 4;}elseif($k=='UVWX'){echo 5;}elseif($k=='YZ'){echo 6;}?>">
								<?
								if($v){
								foreach($v as $ka=>$va){?>
								<div class="city_text_TT"><?= $ka ?></div>
								<div class="city_text_BB">
									<?foreach($va as $key=>$val){?>
									<span lang="<?= $val['osiiid'] ?>"><?= $val['name'] ?></span>
									<?}?>
									<div style="clear: both;"></div>
								</div>
								<div style="clear: both;"></div>
								<?}
								}

								?>
							</div>
							<?}
							}
							?>
						</div>
					</div>
					<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2" style="margin-top:10px;">
						<select class="form-control" name="hotel" placeholder="酒店选择" data-rel="tooltip" title="酒店选择" style="max-width:210px;">
							<option value="0">请选择酒店</option>
						</select>
					</div>
					<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2" style="margin-top:10px;">
						<button type="reset" class="btn btn-sm btn-default">重置</button>
						<button type="button" class="btn btn-sm btn-primary">更新</button>
					</div>
					<div class="col-xs-12 col-sm-4 col-md-3 col-lg-2" style="margin-top:10px;">
						<label class="sethtml red"></label>
					</div>
				</form>
			</div>
		</div><!-- /.page-content-area -->
	</div><!-- /.page-content -->
</div><!-- /.main-content -->
<!-- inline scripts related to this page -->

<div class="bootbox modal fade bootbox-prompt in" tabindex="-1" role="dialog" aria-hidden="false" id="accountForm" style="position:absolute;display:none;">
	<div style="background-color: #303030;filter:alpha(opacity=70);-moz-opacity:0.7;-khtml-opacity: 0.7;opacity: 0.7;position: fixed;width: 100%;height: 100%;"></div>
	<div class="modal-dialog" style="text-align:center;background:#fff;"><br/>更新中...<br/><img src="/public/home/img/loading_1.gif" /></div>
</div>

<script type="text/javascript">
$("form").submit(function(){return false;})
function search(){
	$.ajax({
        type:'post',
        url:"<?=$this->url('system/serachHotel')?>",
        data:"keyword="+$('input[name="keyword"]').val(),
        dataType:'json',
        success:function (r){
            if(r.state==1){
                $('select[name="hotel"]').html(r.html);
				gritter("gritter-success gritter-light",10000,"操作提示","搜索成功，请选择！");
            }else if(r.state==0){
                gritter("gritter-error gritter-light",10000,"操作提示",r.html);
            }
        },error:function(){
            gritter("gritter-error gritter-light",10000,"操作提示","网络错误！请联系我方工作人员。");
        }
    });
}
$("form button.btn-primary").click(function(){
	if(confirm("更新时间较长，确认更新后，请勿刷新跳转到其它页面！")){
		$(this).html("更新中...").prop("disabled",true);
		$('#accountForm').show();
		$("form label.sethtml").empty();
		$.ajax({
			type:'post',
			url:"<?=$this->url('index/GetHotelFacilityInfo@api')?>",
			data:"category="+$('select[name="hotel"]').val(),
			dataType:'json',
			success:function (r){
				if(r.state==1){
					gritter("gritter-success gritter-light",10000,"操作提示",r.html);$("form label.sethtml").html(r.html);
				}else if(r.state==0){
					gritter("gritter-error gritter-light",10000,"操作提示",r.html);$("form label.sethtml").html(r.html);
				}
				$("form button.btn-primary").html("更新").prop("disabled",false);
				$('#accountForm').hide();
			},error:function(){
			    gritter("gritter-error gritter-light",10000,"操作提示","网络错误！请联系我方工作人员。");
			    $("form label.sethtml").html("网络错误！请联系我方工作人员。");
			    $("form button.btn-primary").html("更新").prop("disabled",false);
				$('#accountForm').hide();
			}
		});
	}
})
$('.searchCity input[name="CityName"]').click(function(){$('#cityItem').show();}).focus(function(){$('#cityItem').show();})
$('#cityItem div.prefix span').click(function(){
	$('#cityItem div.prefix span').removeClass("active");
	$(this).addClass("active");
	$('#cityItem div.city_text').hide();
	$('#cityItem div.city_text_'+$(this).attr('lang')).show();
})
$('#cityItem div.city_text .city_text_BB span').click(function(){
	$('.searchCity input[name="CityName"]').val($(this).html());
	$('.searchCity input[name="city"]').val($(this).attr('lang'));
	$('#cityItem').hide();
})
$(document).click(function(e){
	var e = e || window.event;
	var elem = e.target || e.srcElement;
	elem = $(elem);
	if(elem.parents('.searchCity').length<1){$('#cityItem').hide();}
})
function closeImg(){$('#cityItem').hide();}
</script>